package com.cheer.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author cheer
 */
@Data
public class OaUserUpdateDTO {

    private Integer id;

    @NotBlank(message = "姓名不能为空")
    @Length(max = 10, message = "姓名字符数不能大于10")
    private String name;

    @NotNull(message = "性别不能为空")
    @Range(min = 1, max = 2, message = "性别只能选择男或女")
    private Integer sex;

    @NotBlank(message = "身份不能为空")
    @Length(max = 10, message = "身份字符数不能大于10")
    private String type;

    @NotBlank(message = "政治面貌不能为空")
    @Length(max = 10, message = "政治面貌字符数不能大于10")
    private String politicsStatus;

    @NotBlank(message = "出生年月不能为空")
    @Length(max = 20, message = "出生年月字符数不能大于20")
    private String birthTime;

    @NotBlank(message = "籍贯不能为空")
    @Length(max = 20, message = "籍贯字符数不能大于20")
    private String nativePlace;

    @NotBlank(message = "职业不能为空")
    @Length(max = 50, message = "职业字符数不能大于50")
    private String profession;

    @NotBlank(message = "所属单位不能为空")
    @Length(max = 50, message = "所属单位字符数不能大于50")
    private String department;

    @Length(max = 50, message = "联系方式字符数不能大于50")
    @Pattern(regexp= "(?:0|86|\\+86)?1[3456789]\\d{9}", message = "手机号格式填写不正确！")
    private String phone;

}
